Micron Document




Comment (computer programming)
part 7/37 · 66.0 KB total
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
A common developer practice is to comment out one or more lines of code. The programmer adds comment syntax that converts program code into comments so that what was executable code will no longer be executed at runtime. Sometimes this technique is used to find the cause of a bug. By systematically commenting out and running parts of the program, the offending source code can be located.

Many IDEs support adding and removing comments with convenient user interface such as a keyboard shortcut.

Store metadata

Comments can store metadata about the code. Common metadata includes the name of the original author and subsequent maintainers, dates when first written and modified, link to development and user documentation, and legal information such as copyright and software license.

Some programming tools write metadata into the code as comments.cite-ref-12[12] For example, a version control tool might write metadata such as author, date and version number into each file when it's committed to the repository.cite-ref-13[13]

Integrate with development tools

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────